#ifndef GRAPHICSDEVICE_H_
#define GRAPHICSDEVICE_H_


class GraphicsDevice
{
    private:
        static const int SCREEN_WIDTH = 800;
        static const int SCREEN_HEIGHT = 600;
        static const int SCREEN_BPP = 32;

        TTF_Font* font;
        SDL_Surface* gameScreen;
        SDL_Color textColor;

    public:
        GraphicsDevice();
        void apply_surface(int x, int y, int w, int h, SDL_Surface *source, SDL_Surface *destination);
        static bool init();

        void setGameScreen(SDL_Surface* screen)    {gameScreen = screen;}

        int getScreenWidth()                       {return SCREEN_WIDTH;}
        int getScreenHeight()                      {return SCREEN_HEIGHT;}

        SDL_Surface* load_image(std::string filename);
        SDL_Surface* getGameScreen()               {return gameScreen;}

        static std::unique_ptr<GraphicsDevice> sInstance;

        void setFont(const char* f, int s)         {font = TTF_OpenFont(f, s);}
        TTF_Font* getFont()                        {return font;}
        void setColor(Uint8 r, Uint8 g, Uint8 b)   {textColor = {r, g, b};}
        SDL_Color getTextColor()                   {return textColor;}
};

#endif // GRAPHICSDEVICE_H_
